define([
    "ngController"
],function (appAngular) {

    // 侧栏-组件最外层（外部）
    appAngular.directive("bimviewApiSlider", function () {
        return {
            restrict: "EA",
            replace: true,
            template: `<div class="BIMView-API-slider">
                        <div bim-api-slider></div>
					</div>`,
            link: function ($scope, $elem, attrs) {
                // 侧栏收缩
                $scope.modelSliderShrink = function () {
                    $scope.sliderShrink = true;
                    $(".BIMView-API-content .BIMView-API-slider").css({
                        "-webkit-animation": "sliderShrink 300ms forwards",
                        "-moz-animation": "sliderShrink 300ms forwards",
                        "-ms-animation": "sliderShrink 300ms forwards",
                        "animation": "sliderShrink 300ms forwards"
                    });
                };
                // 侧栏展开
                $scope.modelSliderSpread = function () {
                    $scope.sliderShrink = false;
                    $(".BIMView-API-content .BIMView-API-slider").css({
                        "-webkit-animation": "sliderSpread 300ms forwards",
                        "-moz-animation": "sliderSpread 300ms forwards",
                        "-ms-animation": "sliderSpread 300ms forwards",
                        "animation": "sliderSpread 300ms forwards"
                    });
                };
            }
        };
    });

    return appAngular;
});